//
//  LCDetailCell.m
//  TianXiaShi
//
//  Created by CongCong on 15-7-13.
//  Copyright (c) 2015年 CongCong. All rights reserved.
//

#import "LCDetailCell.h"
#import "UIImageView+WebCache.h"
@implementation LCDetailCell

- (void)awakeFromNib {
    // Initialization code
}
- (void)showModel:(LCSubDetailModel *)model
{
    [self.image sd_setImageWithURL:[NSURL URLWithString:model.thumbImageUrl] placeholderImage:[UIImage imageNamed:@"tupianbg"]];
    self.title.text = model.title;
        NSString *time = [model.memberItem.createDate substringFromIndex:5];
        time = [time substringToIndex:11];
        self.dateAndTimes.text = [NSString stringWithFormat:@"%@ 播放%.2f万次",time,model.memberItem.playTime.floatValue/10000];
}
- (void)showDetilLModel:(LCSubMemItemModel*)model
{
    LCFilesModel *fileModel = model.files[4];
    [self.image sd_setImageWithURL:[NSURL URLWithString:fileModel.mediaUrl] placeholderImage:[UIImage imageNamed:@"tupianbg"]];
    self.title.text = model.name;
    NSString *time = [model.createDate substringFromIndex:5];
    time = [time substringToIndex:11];
    self.dateAndTimes.text = [NSString stringWithFormat:@"%@ 播放%.2f万次",time,model.playTime.floatValue/10000];
}
- (void)showVideoModel:(LCVideoModel *)model
{
    
    [self.image sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:[UIImage imageNamed:@"tupianbg"]];
    self.title.text = model.title;
    NSString *time = [model.memberItem.createDate substringFromIndex:5];
    time = [time substringToIndex:11];
    self.dateAndTimes.text = [NSString stringWithFormat:@"%@ 播放%.2f万次",time,model.playTime.floatValue/10000];
}
- (void)showVideoModel:(LCVideoModel*)model andindexPath:(NSIndexPath*)indexPath
{
    
    [self.image sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:[UIImage imageNamed:@"tupianbg"]];
    self.title.text = model.title;
    NSString *time = [model.memberItem.createDate substringFromIndex:5];
    time = [time substringToIndex:11];
    self.dateAndTimes.text = [NSString stringWithFormat:@"%@ 播放%.2f万次",time,model.playTime.floatValue/10000];
    self.rankLabel.text = [NSString stringWithFormat:@"%ld",(long)indexPath.row+1];
    self.rankLabel.textColor = [UIColor redColor];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
